#pragma once
#include <QMainWindow>
#include "../me/mewindow.h"
#include "../join/joinroom.h"
#include "../video/videoroom.h"
#include "../InviteExpert/inviteexpert.h"

#include "../../room/RoomHandler.h"
#include "../../DB/HistoryHandler.h"

#include <memory>

class InviteExpert; //向前声明

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow {
    Q_OBJECT
public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    void init();
    void showMain();
    void loadCsvToTable(const QString &filePath);
    InviteExpert *inviteExpert;
    RoomHandler* roomHandler;
    HistoryHandler* historyHandler;

protected:
    void showEvent(QShowEvent *event) override;

private:
    std::unique_ptr<Videoroom> videoroom;
    std::unique_ptr<Mewindow> mewindow;
    std::unique_ptr<Joinroom> joinroom;
    Ui::MainWindow *ui;

private slots:
    void on_toolButton_createRoom_clicked();
    void on_pushButton_me_clicked();
    void on_pushButton_joinRoom_clicked();
    void createVideoRoom(const quint16& roomId, const QList<quint16>& partnerList);
};
